package com.seedog.mq.exception;

/**
 * 消息队列的基础异常类
 */
public class MessageQueueException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    
    private int errorCode;
    private String errorMessage;
    
    public MessageQueueException(String message) {
        super(message);
        this.errorMessage = message;
        this.errorCode = 500;
    }
    
    public MessageQueueException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.errorMessage = message;
    }
    
    public MessageQueueException(String message, Throwable cause) {
        super(message, cause);
        this.errorMessage = message;
        this.errorCode = 500;
    }
    
    public MessageQueueException(int errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.errorMessage = message;
    }
    
    // Getters and Setters
    public int getErrorCode() {
        return errorCode;
    }
    
    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
    
    public String getErrorMessage() {
        return errorMessage;
    }
    
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
    
    @Override
    public String toString() {
        return "MessageQueueException{" +
                "errorCode=" + errorCode +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }
}